package com.example.automanagement.mapper;

import com.example.automanagement.entity.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserRoleMapper {
    @Select("SELECT ur.user_id, ur.user_role\n" +
            "FROM user_role ur\n" +
            "LEFT JOIN driver_archives da ON ur.user_id = da.user_id\n" +
            "WHERE ur.user_role = #{userRole} AND da.user_id IS NULL;")
    List<UserRole> getIdByRole(String userRole);
}
